package com.winenine999.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CWinebrandMapper;
import com.winenine999.generator.dao.WinebrandMapper;
import com.winenine999.jdbc.dao.WinebrandDao;
import com.winenine999.model.Page;
import com.winenine999.model.Winebrand;
import com.winenine999.service.IWinebrandService;
@Service
public class WinebrandService implements IWinebrandService {
	@Autowired
	private WinebrandMapper winebrandMapper;
	@Autowired
	private CWinebrandMapper cWinebrandMapper;
	@Autowired
	private WinebrandDao winebrandDao;
	/**
	 * 根据id删除winebrand
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return winebrandMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段添加winebrand
	 */
	@Override
	public int insertSelective(Winebrand winebrand) {
		
		return winebrandMapper.insertSelective(winebrand);
	}
	/**
	 * 根据id查询winebrand
	 */
	@Override
	public Winebrand selectByPrimaryKey(Integer id) {
		
		return winebrandMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改winebrand
	 */
	@Override
	public int updateByPrimaryKeySelective(Winebrand winebrand) {
	
		return winebrandMapper.updateByPrimaryKeySelective(winebrand);
	}
	//---------------------custom----------------------------------------
	/**
	 * 全查winebrand
	 */
	@Override
	public List<Map<String, Object>> findAllWinebrands() {
		
		return cWinebrandMapper.findAllWinebrands();
	}
	/**
	 * 分页查询winebrands
	 */
	@Override
	public Page findPageWinebrands(Page page) {
		
		return winebrandDao.findPageWinebrands(page);
	}
}
